home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _97f1f2951fe83425a9fb049bf7e09244 < prev    next >
Encoding:
Text File  |  2002-06-17  |  1012 b   |  44 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Listbox.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Listbox;
  5.  
  6. #line 437 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\Cancel.al)"
  7. # Cancel
  8. #
  9. # This procedure is invoked to cancel an extended selection in
  10. # progress. If there is an extended selection in progress, it
  11. # restores all of the items between the active one and the anchor
  12. # to their previous selection state.
  13. #
  14. # Arguments:
  15. # w - The listbox widget.
  16. sub Cancel
  17. {
  18.  my $w = shift;
  19.  if ($w->cget('-selectmode') ne 'extended' || !defined $Prev)
  20.   {
  21.    return;
  22.   }
  23.  $first = $w->index('anchor');
  24.  $last = $Prev;
  25.  if ($first > $last)
  26.   {
  27.    $tmp = $first;
  28.    $first = $last;
  29.    $last = $tmp
  30.   }
  31.  $w->selectionClear($first,$last);
  32.  while ($first <= $last)
  33.   {
  34.    if (Tk::lsearch(\@Selection,$first) >= 0)
  35.     {
  36.      $w->selectionSet($first)
  37.     }
  38.    $first += 1
  39.   }
  40. }
  41.  
  42. # end of Tk::Listbox::Cancel
  43. 1;
  44.